package com.dyh.quickdemo.bizDemo.tryClose;

import org.junit.jupiter.api.Test;

import java.io.BufferedReader;
import java.io.FileReader;

/*
@Author=Joey Wheeler
@Date=2021/3/10 11:13
*/
public class MyAutoCloseTest {

    public static String fun() throws Exception {
        try(MyAutoClose myAutoClose = new MyAutoClose(()->"hello")){
            return myAutoClose.get();
        }
    }

    @Test
    public void test() throws Exception {

        System.out.println(fun());
//        try (BufferedReader br = new BufferedReader(new FileReader(path))) {
//            return br.readLine();
//        }
    }
}
